function e() {
    this.weekArr = [ "周一", "周二", "周三", "周四", "周五" ];
}

Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.default = void 0, e.prototype._padLeftZero = function(e) {
    return ("00" + (e = String(e))).substr(e.length);
}, e.prototype.getLocalTime = function(e) {
    var t, r = (t = "number" != typeof parseInt(e) ? new Date(e) : new Date(1e3 * parseInt(e))).getFullYear() + "-" + this._padLeftZero(t.getMonth() + 1) + "-" + this._padLeftZero(t.getDate()) + " " + this._padLeftZero(t.getHours()) + ":" + this._padLeftZero(t.getMinutes() + 1), s = new Date(), a = s.getDate(), n = s.getMonth() + 1, i = s.getFullYear(), o = "", u = r.substr(11, 5);
    if (1 == this.isYesterday(s, t)) return (o = "昨天") + " " + u;
    var g = this.isWeek(s, t);
    if (g.is && g.cWeek - g.tWeek >= 2) return (o = this.weekArr[g.tWeek - 1]) + " " + u;
    if (r.substr(0, 4) == i) if (r.substr(5, 2) == n) {
        if (r.substr(8, 2) == a) return u;
        o = r.substr(5, 5);
    } else o = r.substr(5, 5); else o = r.substr(0, 7);
    return o + " " + u;
}, e.prototype.isYesterday = function(e, t) {
    var r = new Date(t.getFullYear() + "/" + (t.getMonth() + 1) + "/" + t.getDate());
    return (new Date(e.getFullYear() + "/" + (e.getMonth() + 1) + "/" + e.getDate()).getTime() - r.getTime()) / 864e5;
}, e.prototype.isWeek = function(e, t) {
    var r = new Date(t.getFullYear() + "/" + (t.getMonth() + 1) + "/" + t.getDate()), s = new Date(e.getFullYear() + "/" + (e.getMonth() + 1) + "/" + e.getDate()), a = 0 == r.getDay() ? 7 : r.getDay(), n = 0 == s.getDay() ? 7 : s.getDay();
    return {
        is: !((s.getTime() - r.getTime()) / 864e5 >= 7) && (a == n || !(n <= a)),
        cWeek: n,
        tWeek: a
    };
};

var t = new e(), r = t.getLocalTime.bind(t);

exports.default = r;